{% import "_includes/forms" as forms %}

{%- set class = [
    'nicetext',
    field.code ? 'code',
    field.uiMode == 'enlarged' ? 'readable',
]|filter %}

{% set config = {
    id: name|id,
    name: name,
    value: value,
    class: class,
    maxlength: field.charLimit,
    showCharsLeft: true,
    placeholder: field.placeholder ? field.placeholder|t('site'),
    rows: field.initialRows
} %}

{% if field.multiline %}
    {{ forms.textarea(config) }}
{% else %}
    {{ forms.text(config) }}
{% endif %}
